<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text">
<input type="button" value="帅哥" onclick="f(1)">

<input type="button" value="美女" onclick="f(2)">
<hr>
<script>

  function f(x) {

    let inp = document.querySelector("input")
    for(let c=0;c<inp.value;c++){
        let url = x==1?"../01.jpg":"../001-C.jpg";
      let i = document.createElement("img");
      i.src=url;
      document.body.append(i)
    }

    // switch (x){
    //   case 1:
    //     let i = document.createElement("img");
    //     i.src="../01.jpg";
    //     document.body.append(i)
    //         break
    //   case 2:
    //    let i2 = document.createElement("img");
    //     i2.src="../001-C.jpg";
    //     document.body.append(i2)
    //     break
    // }
  }
</script>
</body>
</html>